Typedef declarations simply allow the programmer to define synonyms for commonly-used data types. (Again, these synonyms must follow identifier naming rules*. Some programmers capitalize the first or all letters in the synonym.) For example, if the programmer wants to define variables which take on integer values but which are treated as boolean variables (only 0 or 1 allowed) in his/her own code, the following declaration may be used:
typedef int boolean; /* just do this once, at top of file */
boolean success; /* success is actually an int variable */
If pointers to personnel_rec structures are used frequently, the following may be used:
typedef struct personnel_rec* pr_ptr; /* just do this once, at top of file */
pr_ptr person; /* same as: struct personnel_rec *person */